﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Rappelz.GameServer
{
    public class StateInfo
    {
        public const int MAX_STATE_VALUE = 20;
        
        public enum AttributeFlag : int
        {
            EraseOnDead = 0x1,
            EraseOnLogout = 0x2,
            TimeDecreaseOnLogout = 0x4,
            NotUsableOnBoss = 0x8,
            NotErasable = 0x10,
            EraseOnRequest = 0x20,
            EraseOnDamage = 0x40,
            EraseOnResurrect = 0x80,
            EraseOnQuitHuntaholic = 0x100,
            EraseOnQuitDeathmatch = 0x200,
            NotErasableOnEnterDeathmatch = 0x400,
            NotActableOnDeathmatch = 0x800,
            EraseOnCompeteStart = 0x1000,
            NotActableInCompete = 0x2000
        }

// Enum           :   <unnamed-tag>, Type: int
// Data           :     constant 0x0, Constant, Type: int, TYPE_NORMAL
// Data           :     constant 0x1, Constant, Type: int, TYPE_DUPLICATE
// Data           :     constant 0x2, Constant, Type: int, TYPE_DEPENDENCE
// Enum           :   <unnamed-tag>, Type: int
        public int id;                                              // 0x0
        public int name_id;                                         // 0x4
        public int tooltip_id;                                      // 0x8
        public sbyte is_harmful;                                    // 0xC
        public int state_time_type;                                 // 0x10
        public int state_group;                                     // 0x14
        public int[] duplicate_group = new int[3];                  // 0x18
        public sbyte uf_avatar;                                     // 0x24
        public sbyte uf_summon;                                     // 0x25
        public sbyte uf_monster;                                    // 0x26
        public int unkw1;
        public ushort reiteration_count;
        public int base_effect_id;                                  // 0x28
        public int fire_interval;                                   // 0x2C
        public int elemental_type;                                  // 0x30
        public float amplify_base;                                  // 0x34, class c_fixed<10000>
        public float amplify_per_skl;                               // 0x3C, class c_fixed<10000>// 
        public int add_damage_base;                                 // 0x44
        public int add_damage_per_skl;                              // 0x48
        public int effect_type;                                     // 0x4C
        public float[] fValue = new float[MAX_STATE_VALUE];         // 0x50, class c_fixed<10000>[0x14] 
        public bool is_log_required_on_expiration;

        public void Copy(StateInfo info)
        {
            id = info.id;
            name_id = info.name_id;
            tooltip_id = info.tooltip_id;
            is_harmful = info.is_harmful;
            state_time_type = info.state_time_type;
            state_group = info.state_group;
            duplicate_group[0] = info.duplicate_group[0];
            duplicate_group[1] = info.duplicate_group[1];
            duplicate_group[2] = info.duplicate_group[2];
            uf_avatar = info.uf_avatar;
            uf_summon = info.uf_summon;
            uf_monster = info.uf_monster;
            unkw1 = info.unkw1;
            base_effect_id = info.base_effect_id;
            fire_interval = info.fire_interval;
            elemental_type = info.elemental_type;
            amplify_base = info.amplify_base;
            amplify_per_skl = info.amplify_per_skl;
            add_damage_base = info.add_damage_base;
            add_damage_per_skl = info.add_damage_per_skl;
            effect_type = info.effect_type;
            for(int i = 0; i < MAX_STATE_VALUE; ++i)
            {
                fValue[i] = info.fValue[i];
            }
        }
    }
}
